#!/usr/bin/env python
from new_test import *
from snort_rules import SnortRule
from boofuzz import *
path = "/root/github/internet_product_safe_test/analyze_of_complexity"

def main():
    session = Session(
            target=Target(connection=TCPSocketConnection("172.17.0.2", 21)
                ),
            )

    s_initialize(name="Request")
    s_static("POST /index.html HTTP/1.1")
    s_static("\r\n\r\n", "Request-CRLF")
    with open('./expRules.rules') as f:
        rule = f.read()

    c = SnortRule(rule)
    d = ConstructHardMatchData(c,300)
    d.show_content_and_pcre()
    d.construct_data()
    d.data_add_last_pcre()
    s_static(d.data)
    s_string("/index.html")
    s_static("\r\n")
    session.connect(s_get("Request"))
    #session.fuzz_single_case(1)
    session.fuzz()

if __name__ == "__main__":
    main()
